package com.frank.utils;

public enum RecruitProcessEnum {
    Filter(1,"简历筛选中"),WrittenTest(2,"笔试中"),Interview(3,"面试中"),Offer(4,"offer"),Work(5,"入职");

    private int index;
    private String processName;

    RecruitProcessEnum(int index, String processName) {
        this.index = index;
        this.processName = processName;
    }

    public static String getName(int index) {
        for (RecruitProcessEnum recruitProcessEnum : RecruitProcessEnum.values()) {
            if (recruitProcessEnum.getIndex() == index) {
                return recruitProcessEnum.processName;
            }
        }
        return null;
    }

    public static Integer getIndexByName(String name) {
        for (RecruitProcessEnum recruitProcessEnum : RecruitProcessEnum.values()) {
            if (recruitProcessEnum.getProcessName().equals(name)) {
                return recruitProcessEnum.index;
            }
        }
        return null;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }
}
